import {notification, message, Modal} from 'ant-design-vue'
import LocaleUtil from "./LocaleUtil";

const MessageUtil = {
  info(content, title) {
    /*notification.info({
      message: title || '信息',
      description: content,
      duration: 3
    })*/

    message.info(content, 3);
  },
  success(content, title) {
    /*notification.success({
      message: title || '信息',
      description: content,
      duration: 1.5
    })*/

    message.success(content, 1.5);
  },
  warning(content, title) {
    /*notification.warning({
      message: title || '警告',
      description: content,
      duration: 3
    })*/

    message.warning(content, 3);
  },
  error(content, title) {
    notification.error({
      message: title || LocaleUtil.getLocale('m.common.title.error'),
      description: content,
      duration: null
    })

    // message.error(content, 0);
  },
  warningWithBut(content, title) {
    Modal.warning({
      title: title || LocaleUtil.getLocale('m.common.title.warning'),
      content: content
    })
  }
  // loading (content) {
  // }
}

export default MessageUtil
